<template>
<el-container>
  <el-header style="
    position:fixed;
    width: 100%;
    background-color: #ffffff;
    color: #888;
    text-align: center;
    height: 53px!important;
    line-height: 48px;
    padding: 0px!important;
    font-size: 0.398cm;
    z-index: 2;
    ">
    <el-row>
      <el-col id="page1Tag" :span="8" @click="$router.push('/')"><span>处理表单</span></el-col>
      <el-col id="page2Tag" :span="8" @click="$router.push('/2')"><span>表单预览</span></el-col>
      <el-col id="page3Tag" :span="8" @click="$router.push('/3')"><span>查看流程</span></el-col>
    </el-row>
  <div style="
    content: ' ';
    position: relative;
    left: 0;
    top: 0;
    height: 0;
    width: 100%;
    border-top: 1px solid #bcbab6;
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    -webkit-transform: scaleY(.5);
    transform: scaleY(.5);
    "></div>

  <transition name="fade">
    <div v-if="showReply" style="
      position: fixed;
      z-index: 5;
      width: 100%;
      height: 53px;
      top: 0;
      left: 0;
      background: rgba(0,0,0,.2);
    " @click="showReply = false"></div>
  </transition>
  
  </el-header>
  <el-main style="
    height: 100vh;
    overflow: scroll;
    overflow-x: hidden;">
    <div id="dv-status">已办结</div>
    <div id="spaceTop"/>
    <div style="background-color: white;">
      <table id="table1"
        ontouchstart='this.style.cssText += "background-color:#efeff4"'
        ontouchend='this.style.cssText += "background-color:white"'
        @click="$router.push('/2')"
        ><tr>
      <td style="width:62.8px;"><div style="width:50px;height:50px;margin-right:12.8px;line-height: 50px;"><img v-if="sex==='男'" src="../public/p1Man.jpg"><img v-if="sex==='女'" src="../public/p1woman.jpg"></div></td>
      <td style="text-align: left;">
      <span class="title">中国医科大学校内学生出入校审批表</span><br/>
      <span @mouseover="$router.push('/0')" style="
        color: rgb(63, 176, 251);
        text-decoration: underline;
        --darkreader-inline-color: #47b3fb;
        ">{{username}}</span><span>&nbsp;&nbsp;</span><span>{{signFormTimeLong}}</span><br/>
      <span>学生类型：研究生</span><br/>
      <span>填表日期：{{signFormTime}}</span><br/>
      <span>院系领导审批人：皮静波</span><br/>
      <span>姓名：{{username}}</span><br/>
      <span>本人电话：{{phone}}</span><br/>
      <span>学号：{{xuehao}}</span><br/>
      <span>性别：{{sex}}</span><br/>
      <span>学院：公共卫生学院</span><br/>
      <span>专业：公共卫生</span><br/>
      <span>宿舍及门牌号：{{domitory}}</span><br/>
      <span>辅导员姓名：王宇晗</span><br/>
      <span>出入校原因：{{reason}}</span><br/>
      <span>出发地：医大沈北校区</span><br/>
      <span>目的地及接触人员：沈阳航空航天大学附近</span><br/>
      <span>出行方式及路线：197公交车</span><br/>
      <span>离校日期及时间：{{leaveTime}}</span><br/>
      <span>返校日期及时间：{{backTime}}</span><br/>
      </td></tr></table>
<div class="divider1"></div>
<table class="table2"
  ontouchstart='this.style.cssText += "background-color:#efeff4"'
  ontouchend='this.style.cssText += "background-color:white"'
  @click="$router.push('/2')"
  ><tr>
    <td><span>表单预览</span></td>
    <td class="table2right"><div/></td>
  </tr>
</table>
<div class="divider1"></div>
<table class="table2"
  ontouchstart='this.style.cssText += "background-color:#efeff4"'
  ontouchend='this.style.cssText += "background-color:white"'
  @click="showQRCode = true"
  ><tr>
    <td><span>二维码</span></td>
    <td class="table2right"><div/></td>
  </tr>
</table>
  </div>
<div class="space1"></div>

<div style="background-color: white;">
<div class="table3div">
<table class="table3">
  <tr>
    <td><img style="
      float:left;
      margin-right: 9px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      vertical-align: top;
      " src="../public/p1Woman.jpg"><span class="table3name" style="float:left;line-height: 20px;">王宇晗</span></td>
    <td><div class="table3reply" @click="showReply = true">回复</div></td>
  </tr>
</table>
<div class="divider1"></div>
<table class="table4">
  <tr>
    <td colspan="2"><span class="table4a">注意防护，注意安全</span></td>
    <td></td>
  </tr>
  <tr>
    <td><span class="table4b">已通过</span><span class="table4c">{{replyTime}} 10:23</span></td>
    <td><span class="table4d">用时21小时</span></td>
  </tr>
</table>
</div>
<div class="space2"></div>
</div>

<div style="background-color: white;">
<div class="table3div">
<table class="table3">
  <tr>
    <td><img style="
      float:left;
      margin-right: 9px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      vertical-align: top;
      " src="../public/p1Man.jpg"><span class="table3name" style="float:left;line-height: 20px;">皮静波</span></td>
    <td><div class="table3reply" @click="showReply = true">回复</div></td>
  </tr>
</table>
<div class="divider1"></div>
<table class="table4">
  <tr>
    <td colspan="2"><span class="table4a">同意</span></td>
    <td></td>
  </tr>
  <tr>
    <td><span class="table4b">已通过</span><span class="table4c">{{replyTime}} 11:50</span></td>
    <td><span class="table4d">用时22小时</span></td>
  </tr>
</table>
</div>
<div class="space2"></div>
</div>

<div style="background-color: white;">
<div class="table3div">
<table class="table3">
  <tr>
    <td><img style="
      float:left;
      margin-right: 9px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      vertical-align: top;
      " src="../public/p1Man.jpg"><span class="table3name" style="float:left;line-height: 20px;">
        赵永康</span></td>
    <td><div class="table3reply" @click="showReply = true">回复</div></td>
  </tr>
</table>
<div class="divider1"></div>
<table class="table4">
  <tr>
    <!--td colspan="2"><span class="table4a">注意防护，注意安全</span></td-->
    <td></td>
  </tr>
  <tr>
    <td><span class="table4b">已通过</span><span class="table4c">{{replyTime}} 13:09</span></td>
    <td><span class="table4d">用时25小时</span></td>
  </tr>
</table>
</div>
<div class="space2"></div>
</div>

<div style="background-color: white;">
<div class="table3div">
<table class="table3">
  <tr>
    <td><img style="
      float:left;
      margin-right: 9px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      vertical-align: top;
      " src="../public/p1Man.jpg"><span class="table3name" style="float:left;line-height: 20px;">
        刘强</span></td>
    <td><div class="table3reply" @click="showReply = true">回复</div></td>
  </tr>
</table>
<div class="divider1"></div>
<table class="table4">
  <tr>
    <td colspan="2"><span class="table4a">注意防护，出沈阳市，返校时需携带48小时内核酸检测阴性报告入校。</span></td>
  </tr>
  <tr>
    <td><span class="table4b">已通过</span><span class="table4c">{{replyTime}} 15:20</span></td>
    <td><span class="table4d">用时27小时</span></td>
  </tr>
</table>
</div>
<div class="space2"></div>
</div>

<div class="space1"></div>

</el-main>
<el-footer style="
  position: fixed;
  bottom: 0;
  width:100vw;
  height:52px;
  vertical-align: middle;
  text-align: center;
  background-color: #f7f7fa;
  padding:0;
">
<div style="
  position: relative;
  line-height: 40px;
  background-color: #eeeeee;
  height: calc(52px - 10px - 2px);
  vertical-align: middle;
  font-size: 17px;
  color: #454545;
  margin: 5px 15px;
  border: 0.1mm solid #bebebe;
  border-radius: 5px;
" @click="drawer = true">
  后续处理
</div>
</el-footer>
</el-container>

<el-drawer
  v-model="drawer"
  :direction="'btt'"
  :size="140"
  :show-close="false"
  :withHeader="false"
>
<table style="margin: -20px; width:100vw;">
  <tr style="height:45px;">
    <td colspan="2" style="
      background-color: #f7f7f8;
      text-align: right;
          font-size: 15px;
          padding-right: 20px;
          color: #04be00;
          border: 0.1mm solid #d9d9d9;
      "><span @click="drawer = false">关闭</span></td>
  </tr>
  <tr style="height:95px;">
    <td style="
      width: 125px;
      border-right: 0.1mm solid #d9d9d9;
      text-align: center;
      "
      ontouchstart='this.style.cssText += "background-color:#efeff4"'
      ontouchend='this.style.cssText += "background-color:white"'
      >
      <img src="../public/p1Send.png" style="height: 28px; position: relative;"/><br>
      <span style="font-size: 14px; position: relative;">发送表单给我</span></td>
    <td style="
      width: calc(100vw - 126px);"></td>
  </tr>
</table>
</el-drawer>

<transition name="fade">
  <div v-if="showQRCode" style="
    position: fixed;
    top: 0px;
    left: 0px;
    right: 0px;
    background-color: rgba(0,0,0,0.2);
    z-index: 5;
    ">
    <img src="../public/p1QRCode.jpeg" style="
      padding: 10% 10% 3% 10%;
      width: 80%;
      background-color: #f7f7fa;
      border-bottom: 0.1mm solid #e5e5e5;"/>
    <div style="
      background-color: #f7f7fa;
      display: block;
      -webkit-box-flex: 1;
      flex: 1;
      padding: 7px 15px 5px;
      margin-top: -7px;
      -webkit-tap-highlight-color: transparent;
      max-height: 50px;
      overflow: hidden;">
      <div id="btn-close" @click="showQRCode = false" style="
        position: relative;
        display: block;
        margin-left: auto;
        margin-right: auto;
        padding-left: 14px;
        padding-right: 14px;
        box-sizing: border-box;
        font-size: 18px;
        text-align: center;
        text-decoration: none;
        color: #fff;
        line-height: 2.33333333;
        border-radius: 5px;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        overflow: hidden;
        background-color: #EF4F4F;
        ">关闭</div>
    </div>
    <div @click="showQRCode = false" style="height: 501px;"/>
  </div>
</transition>

<transition name="fade">
  <div v-if="showReply">
    <div style="
      position: fixed;
      z-index: 5;
      width: 100%;
      height: 100%;
      top: 53px;
      left: 0;
      background: rgba(0,0,0,.2);
      " @click="showReply = false">
      </div>
    <div style="
      left: 7.5%;
      top: 30%;
      z-index: 6;
      position: fixed;
      width: 85%;
      line-height: 1.6;
      background-color: #fafafc;
      border-radius: 3px;
      ">
      <div style="
        padding: 1.2em 0 .5em;
        font-weight: 400;
        font-size: 14px;
        color: red;
        text-align: center;
        "><span>※ 回复内容（120字以内）</span></div>
      <div style="
        text-align: center;
        padding: 0 20px;
        ">
        <textarea style="
          display: block;
          outline: 0;
          width: 100%;
          padding: 4px 0px 4px 6px;
          height: 72px;
          border: 0.1mm solid #ccc;
          top: 50%;
          left: 50%;
          border-radius: 2px;
          resize: none;
          font-size: 1em;
          " placeholder="请输入回复内容" autofocus="autofocus" rows="3"></textarea>
      </div>
      <div style="
        position: relative;
        line-height: 42px;
        margin-top: 20px;
        font-size: 17px;
        "><table style="
          width: 100%;
          text-align: center;
          border-top: 0.1mm solid #e7e7e9;
          ">
          <tr>
            <td style="
              border-right: 0.1mm solid #e7e7e9;
              " @click="showReply = false"
              ontouchstart='this.style.cssText += "background-color:#efeff4"'
              ontouchend='this.style.cssText += "background-color:#fafafc"'>取消</td>
            <td style="
              color: #58cd3f;
              " @click="showReply = false"
              ontouchstart='this.style.cssText += "background-color:#efeff4"'
              ontouchend='this.style.cssText += "background-color:#fafafc"'>确定</td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</transition>
</template>

<style scoped>

.fade-enter-active, .fade-leave-active {
  transition: opacity 0.5s ease;
}

.fade-enter-from, .fade-leave-to {
  opacity: 0;
}

#spaceTop{
  position: relative;
  background-color: #efeff4;
  height: 28px;
}
#dv-status{
  overflow: hidden;
  background-color: #000000 !important;
  position: relative;
  width: 100px;
  font-size: 14px;
  line-height: 22px;
  height: 22px;
  left: calc(100vw - 75px);
  transform: rotate(45deg);
  color: white;
  text-align: center;
  font-size: 14px;
  top: 61px;
  }

.space1{
  height: 70px;
  background-color: #efeff4;
}
#page1Tag {
  color: rgb(66, 170, 222);
  border-bottom: 3px solid #2FA1DB;
}
#table1 img{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 5px;
}

#table1 {
  top:12px;
  padding: 15px;
  border-spacing: 0px;
  background-color: white;
  width: 100%;
}
#table1 td{
  vertical-align: top;
  padding: 0px;
}
#table1 td * {
  vertical-align: top;
}
table{
  border-spacing: 0px;
}
td{
  padding: 0;
}
#table1 td span:not(.title){
  font-size: 12px;
      color: #999;
      line-height: 18px;
}
#table1 td span:is(.title){
      color: #666;

      white-space: normal;
    font-weight: bold;
    line-height: 24px;
    font-size: 14px;
}

.table2{
  padding:0;
  border-spacing:0;
  width: 100%;
}

.table2 span{
  text-align: left;
  display: block;
  color: #586c94;
  font-size: 14px;
  padding: 10px 15px 12px;
  top:-2px;
  height:21px;
  line-height:20px;
}
.divider1{
  content: ' ';
  position: relative;
  left: 0;
  top: 0;
  height: 0;
  bottom: 0;
  width: calc(100% - 15px);
  border-top: 1px solid #e5e5e5;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: scaleY(.5);
  transform: scaleY(.5);
  left: 15px;
  border-width: 1px 1px 0 0;
}

.table2right{
  text-align: right;
}
.table2right div{
  content: ' ';
  display: inline-block;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
  height: 6px;
  width: 6px;
  border-width: 2px 2px 0 0;
  border-color: #c7c7cc;
  border-style: solid;
  position: relative;
  top: -2px;
  right: 15px;
  top: 50%;
  margin-top: -4px;
}

.divider1{
  content: ' ';
  position: relative;
  left: 0;
  top: 0;
  height: 0;
  bottom: 0;
  width: calc(100% - 15px);
  border-top: 1px solid #e5e5e5;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: scaleY(.5);
  transform: scaleY(.5);
  left: 15px;
  border-width: 1px 1px 0 0;
}

table{
  border-spacing: 0px;
}
td{
  padding: 0;
}
.divider1{
  content: ' ';
  position: relative;
  left: 0;
  top: 0;
  height: 0;
  bottom: 0;
  width: calc(100% - 15px);
  border-top: 1px solid #e5e5e5;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: scaleY(.5);
  transform: scaleY(.5);
  left: 15px;
  border-width: 1px 1px 0 0;
}

.space2{
  height: 10px;
  background-color: #efeff4;
}
.table3{
  width: 100%;
}

.table3 td{
  padding: 14px 15px 10px;
    color: #999;
    font-size: 13px;
    position: relative;
}
.table3name{
  color: #3FB0FB;
  text-decoration: underline;
}
.table3reply{
  top: 13px;
  float: right;
  line-height: 1.9;
  font-size: 14px;
  padding: 0 .75em;
  background-color: #04be02;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  color: #fff;
  border-radius: 5px;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  overflow: hidden;
  margin: 0px;
  list-style-type: none;
}
.table4{
  padding: 5px 15px;
  width: 100%;
}
.table4a{
  float: left;
  text-align: left;
  line-height: 18px;
  font-size: 0.9em;
  color: #333
}
.table4b{
  float: left;
  line-height: 18px!important;
  font-size: 13px;
  color: rgb(153, 153, 153);
  --darkreader-inline-color: #a8a095;
  margin-right: 13px;
}
.table4c{
  float: left;
  line-height: 18px!important;
  font-size: 13px;
  color: #cecece;
}
.table4d{
  font-size: 13px;

  float: right;
  padding-right: 0px;
  color: #cecece;
}

</style>

<script>
import { mapMutations } from "vuex";
import moment from 'moment'
export default ({
  setup() {
    document.title= "处理表单";
  },
  data() {
    return {
      drawer: false,
      showQRCode: false,
      showReply: false,
      username: "",
      sex: this.$store.state.sex,
      signFormTimeLong: this.$store.state.signFormTimeLong,
      signFormTime: this.$store.state.signFormTime,
      replyTime: this.$store.state.replyTime,
      leaveTime: this.$store.state.leaveTime,
      backTime: this.$store.state.backTime,
      xuehao: this.$store.state.xuehao,
      domitory: this.$store.state.domitory,
      phone: this.$store.state.phone,
      reason: this.$store.state.reason,
    };
  },
  methods:{
  ...mapMutations(["setInitialTime", "setMessage", "setReason"]),
  },
  created(){
    if (moment(Date()).format("MMDD")!=this.$store.state.initialTime){
      this.setInitialTime(moment(Date()).format("MMDD"));
      this.signFormTimeLong= this.$store.state.signFormTimeLong;
      this.signFormTime= this.$store.state.signFormTime;
      this.replyTime= this.$store.state.replyTime;
      this.leaveTime= this.$store.state.leaveTime;
      this.backTime= this.$store.state.backTime;
    }
    if (this.$store.state.username!=""){
      this.username= this.$store.state.username;
      this.sex= this.$store.state.sex;
    } else {
      this.$router.push("/0");
    }
    if (this.reason==="") {
      this.setMessage("设置好信息后再次出现此页面是因为该页面已被更新")
      this.$router.push("/0");
    }
  }
})
</script>
